<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

</head>
<body>
<div id="bg" >
  hello word<br/>
  {{count}}<br/>
  {{msg}}<br/>
  {{msg1}}<br/>
</div>
<script>

var lick = 'kjk'
    var hei =new Vue({
      el:'#bg',
      //下面设置变量值
      data:{
        count:'0',
        msg:"hello word!!!",
      },
      //watch只监听单个变量值得变化
      watch:{
        msg:function(newval,lodval){
          console.log('newval'+newval)
          console.log('lodval'+lodval)
        }
      },
      // vomputed监听它所包含的所有变量值，如果涉及到本Vue以外的值
      //只有在本Vue中的值变化后 才会重新加载上以外值得变化
      computed:{
        msg1:function(){
          return  'computed'+this.msg+','+this.count+"  "+lick
        }
      }

    })
</script>
</body>
</html>
